#ifndef UAPI_LIBSEMINIX_MMAP_TYPES_H
#define UAPI_LIBSEMINIX_MMAP_TYPES_H

#define VSPACE_OP_PAGE     1
#define VSPACE_OP_AREA     2

#include "hugepage_encode.h"

#define SEMINIX_PROT_NONE		0x00000000   /* page can not be accessed */
#define SEMINIX_PROT_READ		0x00000001	 /* page can be read */
#define SEMINIX_PROT_WRITE	    0x00000002   /* page can be written */
#define SEMINIX_PROT_EXEC		0x00000004   /* page can be executed */

#define SEMINIX_MAP_IO_MASK     0x0000000f
#define SEMINIX_MAP_IO          0x00000001	 /* Memory mapped I/O or similar */
#define SEMINIX_MAP_IO_WC       0x00000002
#define SEMINIX_MAP_IO_NP       0x00000003
#define SEMINIX_MAP_IO_CACHE    0x00000004

#define SEMINIX_MAP_SHARED	    0x00000010   /* Share changes */
#define SEMINIX_MAP_NOPAGEFAULT 0x00000020
#define SEMINIX_MAP_HUGEPAGE    0x00000040

/*
 * Huge page size encoding when SEMINIX_MAP_HUGEPAGE is specified,
 * and a huge page size other than the default is desired.
 */
#define SEMINIX_MAP_HUGE_SHIFT	HUGETLB_FLAG_ENCODE_SHIFT
#define SEMINIX_MAP_HUGE_MASK	HUGETLB_FLAG_ENCODE_MASK

#define SEMINIX_MAP_HUGE_64KB	HUGETLB_FLAG_ENCODE_64KB
#define SEMINIX_MAP_HUGE_512KB	HUGETLB_FLAG_ENCODE_512KB
#define SEMINIX_MAP_HUGE_1MB	HUGETLB_FLAG_ENCODE_1MB
#define SEMINIX_MAP_HUGE_2MB	HUGETLB_FLAG_ENCODE_2MB
#define SEMINIX_MAP_HUGE_8MB	HUGETLB_FLAG_ENCODE_8MB
#define SEMINIX_MAP_HUGE_16MB	HUGETLB_FLAG_ENCODE_16MB
#define SEMINIX_MAP_HUGE_32MB	HUGETLB_FLAG_ENCODE_32MB
#define SEMINIX_MAP_HUGE_256MB	HUGETLB_FLAG_ENCODE_256MB
#define SEMINIX_MAP_HUGE_512MB	HUGETLB_FLAG_ENCODE_512MB
#define SEMINIX_MAP_HUGE_1GB	HUGETLB_FLAG_ENCODE_1GB
#define SEMINIX_MAP_HUGE_2GB	HUGETLB_FLAG_ENCODE_2GB
#define SEMINIX_MAP_HUGE_16GB	HUGETLB_FLAG_ENCODE_16GB

#endif /* !UAPI_LIBSEMINIX_MMAP_TYPES_H */
